package com.sgb.kjwl.view.ui.adapter.shopping;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sgb.kjwl.R;
import com.sgb.kjwl.model.entity.user.SkuItemAttrEntity;

import java.util.List;

/**
 * 作者:张磊
 * 日期:2018/6/20
 * 说明:商品属性item
 */
public class ParamsAdapter extends BaseQuickAdapter<SkuItemAttrEntity, BaseViewHolder> {


    public ParamsAdapter(List<SkuItemAttrEntity> beans) {
        super(R.layout.params_adapter, beans);
    }

    @Override
    protected void convert(BaseViewHolder helper, final SkuItemAttrEntity item) {
        String value = "";
        for (SkuItemAttrEntity.Child o : item.getList()) {
            value += o.getValData() + "、";
        }
        helper
                .setText(R.id.tv_title, item.getParamData())
                .setText(R.id.tv_value, value.substring(0, value.length() - 1));
    }
}
